import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../user/registerFirst.dart';

class UserPage extends StatefulWidget {
  const UserPage({super.key});

  @override
  State<UserPage> createState() => _UserPageState();
}

class _UserPageState extends State<UserPage> {
  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () {
              Get.toNamed("/login");
            },
            child: const Text("登录"),
          ),
          SizedBox(height: 20),
          ElevatedButton(
            onPressed: () {
              Get.toNamed("/registerFirst");
              // 跳转到注册没有返回按钮
              // Get.off(RegisterFirstPage());
            },
            child: const Text("注册"),
          ),
          SizedBox(height: 20),
          ElevatedButton(
            onPressed: () {
              // Navigator.pushNamed(context, "/shop",
              //     arguments: {"title": "shop传值", "aid": 21});
              Get.toNamed("/shop", arguments: {"id": 123456});
            },
            child: Text("跳转路由传值"),
          ),
        ],
      ),
    );
  }
}
